package schema

import (
	"entgo.io/ent"
	"entgo.io/ent/dialect/entsql"
	"entgo.io/ent/schema"
	"entgo.io/ent/schema/field"
	"private-domain-overseas-service/pkg/status/bizadmin"
	"time"
)

// AdminUser holds the schema definition for the MallFans entity.
type AdminUser struct {
	ent.Schema
}

// Fields of the AdminUser.
func (AdminUser) Fields() []ent.Field {
	return []ent.Field{
		field.String("admin_user_username").Unique().NotEmpty().Comment("电话"),
		field.String("admin_user_nickname").Optional().Comment("姓名"),
		field.String("admin_user_email").Optional().Comment("邮箱"),
		field.String("admin_user_password").NotEmpty().Comment("密码"),
		field.Int64("admin_user_status").Default(bizadmin.StatusOpen).Comment("状态1、正常,2、停用"),
		field.Int64("is_delete").Default(bizadmin.NotDelete).Comment("是否删除，1、未删除,2、表示删除"),
		field.Time("create_at").Immutable().Default(time.Now).Comment("创建时间"),
		field.Time("update_at").Default(time.Now).Comment("更新时间"),
		field.Time("delete_at").Optional().Comment("删除时间"),
	}
}

func (AdminUser) Annotations() []schema.Annotation {
	return []schema.Annotation{
		entsql.WithComments(true),
		schema.Comment("后台用户表"),
	}
}
